package org.marverse.persistance

import util.TypedKey
import serialization.{ClassRegistry, ObjectOutput, ObjectInput}

abstract class PId {
  def isTemporary: Boolean
  def write(out: ObjectOutput)
}

trait PersistentStore {
  
  def registry: ClassRegistry
  def newPId: PId
  def exists(pid: PId): Boolean
  def load[T](pid: PId, clazz: Class[T]): T
  def store(pid: PId, value: Any)
  def remove(pid: PId)
  def readPId(in: ObjectInput): PId

}
